
@extends('common.layout')

@section('title', '权限管理')

@section('body')
    <body class="pear-container">

        <div class="layui-card">
            <div class="layui-card-body">
                <table id="table" lay-filter="table"></table>
            </div>
        </div>

        <script type="text/html" id="toolbar">
            @if (admin_can('/admin/menu/add'))
            <button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
                <i class="layui-icon layui-icon-add-1"></i>
                新增
            </button>
            @endif
            @if (admin_can('/admin/menu/del'))
            <button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">
                <i class="layui-icon layui-icon-delete"></i>
                删除
            </button>
            @endif
            <button class="pear-btn pear-btn-success pear-btn-md" lay-event="expandAll">
                <i class="layui-icon layui-icon-spread-left"></i>
                展开
            </button>
            <button class="pear-btn pear-btn-success pear-btn-md" lay-event="foldAll">
                <i class="layui-icon layui-icon-shrink-right"></i>
                折叠
            </button>
            @if (admin_can('/admin/menu/createjson'))
            <button class="pear-btn pear-btn-success pear-btn-md" lay-event="createjson">
                <i class="layui-icon layui-icon-senior"></i>
                生成安装json
            </button>
            @endif
        </script>

        <script type="text/html" id="bar">
            @if (admin_can('/admin/menu/add'))
            @{{# if (d.type == 'menu'){ }}
                <button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="add"><i class="layui-icon layui-icon-add-1"></i></button>
            @{{# } }}
            @endif
            @if (admin_can('/admin/menu/edit'))
            <button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
            @endif
            @if (admin_can('/admin/menu/del'))
            <button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
            @endif
        </script>

        <script type="text/html" id="type">
            @{{#if (d.type == 'menu') { }}
            <span>菜单</span>
            @{{# }else{ }}
            <span>按钮</span>
            @{{# } }}
        </script>

        <script type="text/html" id="status">
            @{{#if (d.status == 'normal') { }}
            <span>正常</span>
            @{{# }else if(d.status == 'disibled'){ }}
            <span>禁用</span>
            @{{# }else{ }}
            <span>隐藏</span>
            @{{# } }}
        </script>

        <script type="text/html" id="targget">
            @{{#if (d.type == '_iframe') { }}
            <span>框架内打开</span>
            @{{# }else{ }}
            <span>弹窗打开</span>
            @{{# } }}
        </script>

        <script type="text/html" id="icon">
            <i class="layui-icon @{{d.icon}}"></i>
        </script>

        @parent
    </body>
@endsection
